public class DrunkBeeSprite extends BeeSprite {

	public DrunkBeeSprite(Gameloop gl) {
		super(gl);

		speedx = 2f;
		speedy = 1f;

		maxlimit = 15;
		speedLimit = random.nextInt(maxlimit) + 1;

		value = 1;
	}

	@Override
	public void update() {
		if (isHit) {
			deadpath();
			return;
		}

		if (++compteur % speedLimit == 0) {
			speedLimit = random.nextInt(maxlimit) + 1;

			flagx = random.nextBoolean();
			flagy = random.nextBoolean();
			compteur = 0;
		}

		flagx = (x >= gameloop.getWidth() - width) ? false : (x < 0) ? true
				: flagx;

		x = (int) (x + (speedx * (flagx ? 1 : -1)));

		flagy = (y >= (gameloop.getHeight()) - height - 25) ? false
				: (y < 80) ? true : flagy;

		y = (int) (y + (speedy * (flagy ? 1 : -1)));

	}

}
